$("#ensure").click(function () {
    var params = {
        name: $("#name").val(),
        user: $("#user").val(),
        follower: $("#follower").val(),
        belonger: $("#belonger").val(),
        oneChannel: $("#oneChannel").val(),
        twoChannel: $("#twoChannel").val(),
        thrChannel: $("#thrChannel").val(),
        remarks: $("#remarks").val(),
        reservationsId: $("#reservationsId").val(),
        customerName: $("#customerName").val(),
        customerPhone: $("#customerPhone").val(),
        outpatientName: $("#outpatientNameV").val()
    };
    if ($("#remarks").val() == "" || $("#remarks").val() == null) {
        alert("请输入备注！");
        return;
    }
    $.ajax({
        url: Feng.ctxPath + "/reservations/insert_second_development", type: "post", data: params, success: function (data) {
            Feng.success('操作成功!');
            $("#cancel").click();
        }, error: function (data) {
            alert('没有权限，请联系管理员!');
        }
    });
});

$("#agree").click(function () {
    var params = {
        examineRemarks: $("#examineRemarks").val(),
        id: $("#ids").val(),
        reservationsId: $("#reservationsId").val()
    };
    if ($("#examineRemarks").val() == "" || $("#examineRemarks").val() == null) {
        alert("请输入备注！");
        return;
    }
    $.ajax({
        url: Feng.ctxPath + "/reservations_second/agree", type: "post", data: params, success: function (data) {
            Feng.success('操作成功!');
            window.parent.SecondDevelopment.search();
            $("#cancel").click();
        }, error: function (data) {
            alert('没有权限，请联系管理员!');
        }
    });
});

$("#refuse").click(function () {
    var params = {
        examineRemarks: $("#examineRemarks").val(),
        id: $("#ids").val()
    };
    if ($("#examineRemarks").val() == "" || $("#examineRemarks").val() == null) {
        alert("请输入备注！");
        return;
    }
    $.ajax({
        url: Feng.ctxPath + "/reservations_second/refuse", type: "post", data: params, success: function (data) {
            Feng.success('操作成功!');
            window.parent.SecondDevelopment.search();
            $("#cancel").click();
        }, error: function (data) {
            alert('没有权限，请联系管理员!');
        }
    });
});

$("#cancel").click(function () {
    parent.layer.close(parent.layer.getFrameIndex(window.name));
});
